using RAG.Application.Services.Interfaces;
using RAG.Domain.Entities.App;
using RAG.Domain.Repositories;

namespace RAG.Application.Services.Implementations;

/// <summary>
/// 对话记录服务实现
/// </summary>
public class ConversationService : IConversationService
{
    private readonly IRepository<Conversations> _conversationRepository;

    public ConversationService(IRepository<Conversations> conversationRepository)
    {
        _conversationRepository = conversationRepository;
    }

    /// <summary>
    /// 保存对话记录
    /// </summary>
    public async Task<Conversations> SaveConversationAsync(Conversations conversation)
    {
        return await _conversationRepository.CreatedAsync(conversation);
    }
}


